import request from '@/utils/request'

// 获取商品列表
export function getAllProduct(params) {
  return request({
    url: '/product/loadList',
    method: 'get',
    params
  })
}

// 根据商品名搜索
export function searchProduct(params) {
  return request({
    url: '/product/search',
    method: 'get',
    params
  })
}

// 商品详情
export function productDet(params) {
  return request({
    url: '/product/detail',
    method: 'get',
    params
  })
}

// 推荐类似商品
export function productRec(params) {
  return request({
    url: '/product/recommend',
    method: 'get',
    params
  })
}

// 添加订单
export function addOrder(params) {
  return request({
    url: '/order/add',
    method: 'post',
    params
  })
}

// 订单
export function orderList(params) {
  return request({
    url: '/order/list',
    method: 'get',
    params
  })
}

// 删除订单
export function delOrder(params) {
  return request({
    url: '/order/delete',
    method: 'post',
    params
  })
}

// 订单: 收货
export function recOrder(params) {
  return request({
    url: '/order/receive',
    method: 'post',
    params
  })
}

// 订单: 评价
export function ratOrder(params) {
  return request({
    url: '/order/ratings',
    method: 'post',
    params
  })
}

// 支付
export function payment(params) {
  return request({
    url: '/order/payment',
    method: 'post',
    params
  })
}
